<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ page import="java.util.ArrayList"%>
<%@ page import=" java.util.List"%>
<%@ page import=" com.demo.entity.User"%>

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>用户信息管理-修改信息</title>
</head>
<body>
    <fieldset>
        <legend style="color: #00f" > <h3 >修改用户权限</h3></legend>
        <%
                User userinfo =  (User)session.getAttribute("user");
         %>
        <form action="/WebStoreSSM/controller/user_info_update_action/<%=userinfo.getUserId()%>" method="post">
            <table>
                <tr><th colspan="7" style="color: #f00">${updateUserMessage}</th></tr>
                <tr><th>编号：</th><th><%=userinfo.getUserId()%></th></tr>
                <tr><th>邮箱：</th><th><%=userinfo.getEmail()%></th></tr>
                <tr><th>账号：</th><th><%=userinfo.getUsername()%></th></tr>
                <tr><th>密码：</th><th><%=userinfo.getPassword()%></th></tr>
                <%if(userinfo.getType() == 1){ %>
                <tr>
                    <th>身份：</th>
                    <th>
	                    <select name="userType">
	                        <option value="1">管理员</option>
	                        <option value="0">普通用户</option>
	                    </select>
                    </th>
                </tr>
                <%} else if(userinfo.getType() == 0){ %>
                <tr>
                    <th>身份：</th>
                    <th>
                        <select name="userType">
                            <option value="0">普通用户</option>
                            <option value="1">管理员</option>
                        </select>
                    </th>
                </tr>
                <%} %>
                
                <%if(userinfo.getState() == 1){ %>
                <tr>
                    <th>状态：</th>
                    <th>
                        <select name="userState">
                            <option value="1">在线</option>
                            <option value="0">离线</option>
                        </select>
                    </th>
                </tr>
                <%} else if(userinfo.getState() == 0){ %>
                <tr>
                    <th>状态：</th>
                    <th>
                        <select name="userState">
                            <option value="0">离线</option>
                            <option value="1">在线</option>
                        </select>
                    </th>
                </tr>
                <%} %>           
                
                <tr><th>注册时间：</th><th><%=userinfo.getRegistTime()%></th></tr>
                <tr><th colspan="7" align="center"><input type="submit" value="修改"/>
                                                        <input type="reset" value="重置"/></th></tr>
                <tr><th colspan="7" align="center"><a href="/WebStoreSSM/controller/user_info_list_action">返回用户信息管理</a></th></tr>
            </table>
        </form>
    </fieldset>
</body>
</html>